<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script type="text/javascript">
        // 用js代码创建html标签并显示在页面上
        // 内容是<div>i love you</div>
        
        window.onload = function() {
            var divObj = document.createElement("div");
    
            divObj.innerHTML = "i love you";

            document.body.appendChild(divObj);
        }
    </script>
</head>
<body>

</body>
</html>